package org.tea.inventory.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class TeaUtils {

    public static String getNumber(){
        SimpleDateFormat sfDate = new SimpleDateFormat("yyyyMMdd");
        String strDate = sfDate.format(new Date());
        String random = getRandom(3);
        return "SUP"+strDate+random;
    }


    public static String getRandom(Integer length) {
        String result = "";
        Random rand = new Random();
        int n = 20;
        if (null != length && length > 0) {
            n = length;
        }
        int randInt = 0;
        for (int i = 0; i < n; i++) {
            randInt = rand.nextInt(10);

            result += randInt;
        }
        return result;
    }
}
